#include "LED.h"
/*------------------------------------------------------------------------------
  configer LED pins
 *------------------------------------------------------------------------------*/
void LED_Config(void) {

	LPC_SC->PCONP 	   |= (1U<<15);					//włącz GPIO
	LPC_GPIO2->FIOMASK &= ~0x000000FC;
	LPC_GPIO2->FIODIR  |=  0x000000FC;				//P2.2-7 as outputs
	LPC_GPIO2->FIOPIN  |=  0x000000FC;
	LPC_GPIO2->FIOPIN  &= ~0x000000FC;
}

/*------------------------------------------------------------------------------
  Switch on LEDs
 *------------------------------------------------------------------------------*/
__INLINE void LED_On (uint32_t led) {

  LPC_GPIO2->FIOPIN |=  (led);                  /* Turn On  LED */
}


/*------------------------------------------------------------------------------
  Switch off LEDs
 *------------------------------------------------------------------------------*/
__INLINE void LED_Off (uint32_t led) {

  LPC_GPIO2->FIOPIN &= ~(led);                  /* Turn Off LED */
}

__INLINE void LED_Toggle (uint32_t led) {

  LPC_GPIO2->FIOPIN ^= (led);                  /* Turn Off LED */
}
